import os

# sbom top dir
SBOM_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SBOM_ELEMENT_TEMPLATE_JOSNS = os.path.join(SBOM_DIR, "config")
SBOM_OUTPUT_PATH = os.path.join(SBOM_DIR, "result")
SBOM_RPM_CPIO_TMP_PATH = os.path.join(SBOM_DIR, "tmp")

SPDXVERSION = "SPDX-2.3"
DATALICENSE = "CC0-1.0"
SPDXID = "SPDXRef-DOCUMENT"
CREATEINFO = {
    "creators": "EPKG",
    "organization": "openEuler",
    "created": "2024",
    "licenseListVersion": "3.22"
  }

PACKAGE_CHECK_SUMS = {
  "algorithm": "sha256",
  "checksumValue": ""
}

PACKAGE_SPDXID = "SPDXRef-Package-{rpm_name}-{checksum}"
SUPPLIER = "Organization: openEuler"
ORIGINATOR = "Organization: openEuler"
REFERENCELOCATOR = "pkg:rpm/openEuler/{rpm_name}@{version}?arch={arch}&distro={os_release}"

FILES_CHECK_SUMS = {
  "algorithm": "MD5",
  "checksumValue": ""
}
FILES_SPDXID = "SPDXRef-File-[{file_path}]-{md5_sum}"


DEP_PACKAGE_SPDX_ELEMENT_FORMAT = "SPDXRef-Package-{rpm_name}-{check_sum}"
DEP_FILE_SPDX_ELEMENT_FORMAT = "SPDXRef-File-[{file_path}]-{check_sum}"

NO_NEED_CHECK_DEP = ['rpmlib(CompressedFileNames)', \
                    'rpmlib(FileDigests)', \
                    'rpmlib(PayloadFilesHavePrefix)', \
                    'rpmlib(PayloadIsXz)']